import { storageSession, storageLocal } from "@pureadmin/utils";
import { nextTick } from "vue";
import { decrypt } from "@/utils/asc";
import { sessionKey, type DataInfo } from "@/utils/auth";
const Layout = () => import("@/layout/index.vue");
const roles = storageLocal().getItem<DataInfo<number>>(sessionKey)?.roles[0]
  ? decrypt(storageLocal().getItem<DataInfo<number>>(sessionKey)?.roles[0])
  : undefined;
export default {
  path: "/",
  name: "Home",
  component: Layout,
  redirect: roles === "stu" ? "/stuindex" : "/welcome",
  meta: {
    icon: "homeFilled",
    title: "首页",
    showLink: false,
    rank: 0
  },
  children: [
    {
      path: "/welcome",
      name: "Welcome",
      component: () => import("@/views/welcome/index.vue"),
      meta: {
        title: "首页"
      }
    }
  ]
} as RouteConfigsTable;
